import service from '@/utils/request'

export function getUserInfoOtherService(data) {
  return service({
    url: '/user/getUserInfoOther',
    method: 'get',
    params: data
  })
}


export function updateUserInfoService(params) {
  return service({
    url: '/user/updateUserInfo',
    method: 'post',
    data: params
  })
}

export function changePasswordService(params) {
  return service({
    url: '/user/changePassword',
    method: 'post',
    data: params
  })
}

export function getUserPostsService(params) {
  return service({
    url: '/user/getUserPosts',
    method: 'get',
    params: params 
  })
}

export function uploadAvatarService(formData) {
  return service({
    url: '/user/updateAvatar',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

export function getUserFavoritesService(params) {
  return service({
    url: '/user/getUserFavorites',
    method: 'get',
    params: params
  })
}